package cn.edu.zzuli.admin.mapper;

import cn.edu.zzuli.model.dto.admin.ComDto;
import cn.edu.zzuli.model.dto.admin.ComplaintDto;
import cn.edu.zzuli.model.entity.ComplaintInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ComplaintMessageMapper extends BaseMapper<ComplaintInfo> {

    @Select("select id,user_id,complaint_info.create_time,nick_name,dealed from complaint_info join user on user_id = uid")
    Page<ComplaintDto> selectListMix(Page<ComplaintDto> dtoPage);

    @Select("select complaint_info.user_id,nick_name,tel,url,url2,url3,description,dealed from complaint_info JOIN user on user.uid = complaint_info.user_id join identity on complaint_info.user_id = `identity`.`iuid` where complaint_info.id = #{id}")
    ComDto selectComDto(Integer id);
}
